1. Field of the Invention
The present invention relates to a technique of detecting a document size with high accuracy.
2. Description of the Related Art
Image reading apparatuses have been used in a wide variety of applications, such as facsimile machines and copying machines, as well as single-function computer peripherals like image scanners. Further, recently, image reading apparatuses have been widely used in multifunction peripherals. A multifunction peripheral (MFP) provides multiple functions, such as an image reading function, a copying function, and a facsimile function.
In an image reading apparatus, it is necessary to detect an area of a document placed on a document positioning plate with high accuracy in order to obtain high-quality digital image data. As a known technique for detecting a position and size of a document with high accuracy, a dedicated sensor having a size detection capability corresponding to a document size (e.g., an optical sensor or a sensor for detecting a position of an original guide that is manually adjusted) is attached to the image reading apparatus. However, if a dedicated sensor is used in the image reading apparatus, it is difficult to improve its productivity, achieve miniaturization, and reduce manufacturing costs. To overcome these problems, it is proposed to perform analysis on an image prescanned with an optical sensor used for general image reading operations and then detect a document size.
For example, a technique discussed in Japanese Patent Application Laid-Open No. 11-155060 analyzes image density of image data obtained by scanning a document to determine a threshold value for defining a document edge (document edge) According to the technique, the image data is analyzed again to set the document edge to where the image density exceeds the threshold value at a certain rate. Further, according to the technique discussed in Japanese Patent Application Laid-Open No. 11-225264, when the document edge cannot be detected with the above-described method, the last detected point on the document is determined as the document edge. Moreover, the technique discussed in Japanese Patent Application Laid-Open No. 2004-032571 determines any particular information of prescanned image data as reference data and compares other data with the reference data to define a document edge. With this processing, a document size can be determined without checking the entire prescanned image data.
Further, the above document size detecting techniques involve some problems. The problems are described with reference to FIGS. 16A to 16F. FIG. 16A illustrates how a document 41 is put on a document positioning plate 25 in alignment with a document stop position 22. If the entire surface of the document positioning plate 25 is scanned in this state, a shadow 43 is cast on the edge of a pre-scanning image by a gap between a pressure plate and the document positioning plate as illustrated in FIG. 16B as discussed in Japanese Patent Application Laid-Open No. 2004-032571. If the detected document is analyzed without any correction, there arises a problem of erroneously detecting the entire document positioning plate surface as a document area. To overcome this problem, as illustrated in FIG. 16C, the document is detected, excluding an area 44 having a width of several mm from the edge of the pre-scanning image. In short, only an image 45 is analyzed as illustrated in FIG. 16D. The width of the area 44 omitted from the pre-scanning image is determined in advance. The width is designed preparing for the worst case in consideration of mechanical accuracy of a copying machine main body and individual differences. Thus, its value is a non-negligible one. Hence, if the document overlaps the edge of the document positioning plate, the area 45 as illustrated in FIG. 16D becomes an analysis-target area, which hinders appropriate detection. As a result, document data is not partially detected. To avoid such a situation, the technique discussed in Japanese Patent Application Laid-Open No. 2004-032571 does not cut off the left edge and upper edge of a pre-scanning image on the assumption that a document abuts against a document stop position 22. In other words, the size of an analysis-target area is increased up to an analysis-target area 46 as illustrated in FIG. 16E (in the following description, an analysis-target area has the increased size of the corrected analysis-target area 46). However, if the lower right side of a document overlaps the area 44 of FIG. 16C, a lower right area of the document is not detected as illustrated in FIG. 16F.
If a size of a document positioning plate is increased enough to prevent the document from overlapping an edge portion of the document positioning plate, with a view to solving this problem, main body size and cost increase. Further, if a shadow tends to appear due to a large gap between the pressure plate and the document positioning plate, even though a document is put within the analysis-target area, the document might be erroneously detected.